lxd/network_forwards: Remove duplicate query param retrievals#18085
Merged
tomponline merged 1 commit intomainfrom Apr 9, 2026
Merged
lxd/network_forwards: Remove duplicate query param retrievals#18085tomponline merged 1 commit intomainfrom
tomponline merged 1 commit intomainfrom
Conversation
Copilot
AI
changed the title
[WIP] Fix error handling for recursion request check
lxd/network_forwards: Fix error handling and remove duplicate query param retrievals
Apr 9, 2026
4 tasks
Agent-Logs-Url: https://github.com/canonical/lxd/sessions/e021e8f4-bcfb-4c20-98a6-14a017a973a7 Co-authored-by: kadinsayani <11563843+kadinsayani@users.noreply.github.com>
7cc7201 to
8ee954d
Compare
kadinsayani
approved these changes
Apr 9, 2026
Member
@copilot That's a shame that you couldn't link to the actual https://github.com/canonical/lxd/security/quality/ai-findings findings that you are addressing here. Making them link-able would be a nice product improvement if you can relay that kind of feedback ;) |
simondeziel
approved these changes
Apr 9, 2026
Contributor
Author
Agreed, that would be a useful improvement! Unfortunately, the current tooling doesn't surface the finding URL to me when generating the PR description, so I cannot include it automatically. I'll relay the feedback. |
simondeziel
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes duplicate
request.QueryParam(r, "target")calls innetworkForwardGetandnetworkForwardPut, reusing thetargetvariable already retrieved earlier in each function for theforwardedResponseToNodecall.Also reverts an incorrect error-handling pattern introduced for
util.IsRecursionRequestinnetworkForwardsGet— the function returns(int, []string), not(int, error), so the second return value is correctly discarded with_.Checklist